/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package kotionokyurievna.gmail.com.callablethreads.threadPack;

import java.util.concurrent.Callable;
import kotionokyurievna.gmail.com.callablethreads.logic.AddSinCalculator;

/**
 *
 * @author Kateryna_Reznik
 */
public class SimpleThread implements Callable<Double>{

    private int number;
    private int arguments[];
    private double sum;
    private AddSinCalculator calculator;
    
    public SimpleThread( int args[], int num){
        int n = args.length;
        arguments = new int[n];
        System.arraycopy(args, 0, arguments, 0, n);
        calculator = new AddSinCalculator();
        number = num;
        sum = 0;
    }
    
    @Override
    public Double call() throws Exception {
         sum = calculator.addSin(arguments);
         return Double.valueOf(sum);
    }
    
    
}
